package com.lagou.serilize;

import com.alibaba.fastjson.JSON;

/**
 * @Description: JSONSerilizer
 * @Author: zhongyuan
 * @CreateDate: 2020/8/19
 * @Version: OSINT1.1
 */
public class JSONSerializer implements Serializer {

    public byte[] serialize(Object object) {
        return JSON.toJSONBytes(object);
    }

    public <T> T deserialize(Class<T> clazz, byte[] bytes) {
        return JSON.parseObject(bytes, clazz);
    }
}
